package com.markus.basic.设计模式.单例模式;

/**
 * Author:markusZhang
 * Date:Create in 2020/8/24 16:22
 * todo: 静态内部类
 */
public class SingleTon4 {
    private static class CreateSingleTon{
        private static SingleTon4 instance;
        public  static SingleTon4 getInstance(){
            if (instance == null){
                instance = new SingleTon4();
            }
            return instance;
        }
    }
    private SingleTon4(){}
    public static SingleTon4 getInstance(){
        return CreateSingleTon.getInstance();
    }
}
